<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> new document </title>
  <meta name="generator" content="editplus" />
  <meta name="author" content="" />
  <meta name="keywords" content="" />
  <meta name="description" content="" />
 </head>

 <body>

 <object id="mplayer" width=400 height=300 classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6">
                    <param name="URL" value="/static/music/info.wav">
                    <param name="autoStart" value="0">
                    <param name="balance" value="0">
                    <param name="baseURL" value>
                    <param name="captioningID" value>
                    <param name="currentPosition" value="0">
                    <param name="currentMarker" value="0">
                    <param name="defaultFrame" value="0">     
                    <param name="enabled" value="1">
                    <param name="enableErrorDialogs" value="0">
                    <param name="enableContextMenu" value="1">               
                    <param name="fullScreen" value="0">      
                    <param name="invokeURLs" value="1">
                    <param name="mute" value="0">
                    <param name="playCount" value="1">   
                    <param name="rate" value="1">
                    <param name="SAMIStyle" value>
                    <param name="SAMILang" value>
                    <param name="SAMIFilename" value>
                    <param name="stretchToFit" value="0">
                    <param name="uiMode" value="invisible">
                    <param name="volume" value="100">
                    <param name="windowlessVideo" value="0">
</object>


 <script type="text/javascript">
 var Eway = {};
  Eway.Sound = function() {
	
	var player;
	var runner;
	
	return {
	
		getPlayer : function() {
			if(!player) {
				player = document.getElementById('mplayer');
				if(!player) {
					alert("Can't get mplayer");
				}
			}
		},
		
		play : function(url) {
			this.getPlayer();
			player.URL = url;
			if(player.controls) {
				player.controls.play();
			}
		},
	
		stop : function() {
			this.getPlayer();
			player.controls.stop();
		},
		
		info : function() {
			this.play("/static/music/info.wav");
			//this.play("http://192.168.0.6:7080/v/audio/1215744700000_381225978_-2167087622421952060.asx");
		},
		
		warn : function() {
			this.play("/static/music/warn.wav");
		},
		
		error : function() {
			this.play("/static/music/error.wav");
		},
		
		fatal : function() {
			this.play("/static/music/fatal.wav");
		},
		
		getMute : function() {
			this.getPlayer();
			return player.settings.mute;
		},
		
		setMute : function(mute) {
			player.settings.mute = mute;
		},
		
		startRun : function(model) {
			runner = new Ext.util.TaskRunner();
			runner.start({
				run : function() {
					Ext.Ajax.request({
						url : model.urlPrefix + '/getSound',
						method : 'GET',
						success : this.onSuccess,
						scope : this
					});
				},
				scope : this,
				interval : 60000
			});
		},
		
		onSuccess : function(response) {
			//console.debug(response.responseText);
			var result = Ext.decode(response.responseText);
			if(result.data.url != '') {
				//console.debug('play url=' + result.data.url);
				this.play(result.data.url);
			}
		},
		
		stopRun : function() {
			runner.stopAll();
		}
		
	}
	
}();
</script>

 </body>
</html>
